<template>
  <div class="app-container">
    <!-- <FilterSearch :value="queryParams" :config="configData" :labelCol="8" :wrapperCol="16" layout="inline"></FilterSearch> -->
    <div class="main">
      <main>
        <!-- <div class="table">
          <a-table :scroll="{ x: 1400 }" bordered :dataSource="tableData.dataSource" :columns="tableData.columns"
            :loading="tableData.loading">
            <template #bodyCell="{ column, record }">
              <template v-if="column.key === 'action'">
                <a-button type="link" @click="handleChange(record, 'details')">
                  详情
                </a-button>
                <a-button type="link" @click="handleChange(record, 'record')">
                  操作记录
                </a-button>
                <a-button type="link" @click="handleChange(record, 'inHome')">
                  入库
                </a-button>
              </template>
            </template>
          </a-table>
        </div> -->
      </main>
    </div>
    <!-- <a-modal v-model:open="modalOpen.open" title="新建仓库" :closable="false" @cancel="cancel('in')"
      @ok="handleChange({}, 'submit')" cancelText="关闭" okText="提交">
      <div class="modal-body">
        <div class="form">
          <a-form :model="formState" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }" autocomplete="off">
            <a-row>
              <a-col :span="24">
                <a-form-item label="仓库名称" name="cangkum">
                  <a-input v-model:value="formState.cangkum" />
                </a-form-item>
              </a-col>
              <a-col :span="24">
                <a-form-item label="货架数量" name="huojiashu">
                  <a-input v-model:value="formState.huojiashu" />
                </a-form-item>
              </a-col>
              <a-col :span="24">
                <a-form-item label="货架排数" name="huojiapai">
                  <a-input v-model:value="formState.huojiapai" />
                </a-form-item>
              </a-col>
              <a-col :span="24">
                <a-form-item label="货架列数" name="huojialie">
                  <a-input v-model:value="formState.huojialie" />
                </a-form-item>
              </a-col>
              <a-col :span="24">
                <a-form-item label="列位置数" name="lieweizhi">
                  <a-input v-model:value="formState.lieweizhi" />
                </a-form-item>
              </a-col>
            </a-row>
          </a-form>
        </div>
      </div>
    </a-modal> -->
    <!-- <div class="btns">
        <a-button v-hasPermi="['user:role:add']">添加</a-button>
        <a-button v-hasPermi="['user:role:edit']">修改</a-button>
        <a-button v-hasPermi="['user:role:remove']">删除</a-button>
      </div> -->
  </div>
</template>
<script setup lang="ts">
import { ref, computed, onMounted, reactive } from 'vue';

interface FormState {
  [props: string]: string | number | Array<object> | Array<string>;
}
let formState:FormState = reactive({
});
const tableData = reactive({
  dataSource: [],
  columns: [
    {
      title: "ID",
      dataIndex: "id",
      key: "id",
      width: 80,
      align: "center",
    },
    {
      title: "合同号",
      dataIndex: "contractNum",
      key: "contractNum",
    },
    {
      title: "承租人",
      dataIndex: "lesseeName",
      key: "lesseeName",
    },
    {
      title: "业务类型",
      dataIndex: "serviceType",
      key: "serviceType",
      width: 90,
      align: "center",
    },
    {
      title: "渠道描述",
      dataIndex: "channelDesc",
      key: "channelDesc",
    },
    {
      title: "业务模式",
      dataIndex: "serviceMode",
      key: "serviceMode",
      width: 90,
      align: "center",
    },
    {
      title: "入池时间",
      dataIndex: "enterPoolTime",
      key: "enterPoolTime",
      width: 160,
      align: "center",
      sorter: {
        compare: (a: any, b: any) => a.enterPoolTime > b.enterPoolTime,
        multiple: 2
      }
    },
    {
      title: "操作",
      key: "action",
      width: 260,
      fixed: "right",
    },
  ],
  modalDataSource: [],
  modalColumns: [
    {
      title: "节点名称",
      dataIndex: "eventNode",
      key: "eventNode",
      width:120
    },
    {
      title: "操作时间",
      dataIndex: "createdTime",
      key: "createdTime",
      width: 160,
      align: "center",
    },
    {
      title: "操作人",
      dataIndex: "createdBy",
      key: "createdBy",
    },
    {
      title: "备注",
      dataIndex: "remark",
      key: "remark",
    }
  ],
  loading: false,
  total: 0,
});
const modalOpen = reactive({
  open: false,
});
const queryParams = ref({
  pageNumber: 1,
  pageSize: 10
});
const configData = computed(() => {
  let config = {
    itemConfig: [],
    operate: [
      {
        icon: "",
        type: "primary",
        name: "新建仓库",
        handleClick: addHome,
        rule: true,
      },
    ],
    rules: {

    },
  };
  return config;
});
function addHome() {
  modalOpen.open = true;
}
function handleChange(row: any = {}, type: string) {
  switch (type) {

  }
}
onMounted(() => {
  
})
</script>
<style lang="less" scoped>
.main {
  min-height: 500px;
}
</style>
